import axios from "../../../utils/axios";

// 登录接口
export const useLogin = (data:any) =>  {
    return axios({
        method:'post',
        url:'/prod-api/api/login',
        data
    })
}

// 用户信息
export const getInfo = (params:any) => {
    return axios({
        method:'get',
        url:"/prod-api/api/common/user/getInfo",
        params,
        headers:{
            'Authorization':window.localStorage.getItem('token')
        }
    })
}

// 修改用户信息
export const  commonUser = (data:any) => {
    return axios({
        method:'put',
        url:'/prod-api/api/common/user',
        data,
        headers:{
            'Authorization':window.localStorage.getItem('token')
        }
    })
}

// 注册
export const register = (data:any) => {
    return axios({
        method:'post',
        url:'/prod-api/api/register',
        data
    })
}

// 修改密码
export const resetPwd = (data:any) => {
    return axios({
        method:'put',
        url:'/prod-api/api/common/user/resetPwd',
        data,
        headers:{
            'Authorization':window.localStorage.getItem('token')
        }
    })
}

// 文件上传
export const upload = (data:any) => {
    return axios({
        method:'post',
        url:'/prod-api/common/upload',
        data,
        headers:{
            'Authorization':window.localStorage.getItem('token')
        }
    })
}